<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*,java.net.*,
com.brother.model.*"   pageEncoding="UTF-8"%><jsp:useBean id="trackerService" class="com.brother.service.TrackerService"></jsp:useBean><%

request.setCharacterEncoding("UTF-8");

String userid = request.getParameter("userid");
String userName = request.getParameter("userName");
String trackerName = request.getParameter("trackerName");
String trackerIME = request.getParameter("trackerIME");
String action = request.getParameter("action");

if(userName != null)
userName = URLDecoder.decode(userName,"utf-8");
if(trackerName != null)
trackerName =(URLDecoder.decode(trackerName,"utf-8"));

System.out.println(request.getRequestURL()+" 00000 "+request.getRequestURI()+"  "+request.getQueryString()+"  "+trackerName);

int start = Integer.parseInt(request.getParameter("start")==null?"0":request.getParameter("start"));

int limit = Integer.parseInt(request.getParameter("limit")==null?"0":request.getParameter("limit"));

List<Tracker> trackers = trackerService.findChildrenTracker(Integer.parseInt(userid), userName, trackerName, trackerIME);






%>{"totalCount":"<%=trackers.size() %>","models":[
<%
if(trackers.size() >= start + limit){
	trackers = trackers.subList(start, start + limit);
}else{
	trackers = trackers.subList(start, trackers.size());
}
for(int i = 0; i < trackers.size(); i++){
%>
{"model":"<%=trackers.get(i).getModelName()%>","uin":'<%=trackers.get(i).getUserTrackerId()%>',
name:'<%=trackers.get(i).getTrackerName().replaceAll("'","\\\\'")%> - <%=trackers.get(i).getUserName().replaceAll("'","\\\\'")%>',
plugin:'<%=trackers.get(i).getModelName()%>.dll',trackerId:'<%=trackers.get(i).getTrackerid()%>',
userName:'<%=trackers.get(i).getUserName().replaceAll("'","\\\\'")%>', trackerName:'<%=trackers.get(i).getTrackerName().replaceAll("'","\\\\'")%>',
carModelId:'<%=trackers.get(i).getCarmodelId()%>'}
<%if(i < trackers.size() - 1){ %>,<%} %><%} %>]}		
<%
com.brother.database.DataBase.closeThreadConnection();
%>		

